﻿/*
 * 创建人:lf
 * 创建时间:2021/5/20 11:33:57
 * 描述:
 * */

using Furion.DatabaseAccessor;
using Mapster;

using Purchasing.Application.Dtos;
using Purchasing.Core; 
using System;

namespace Furion.Application
{
    public class Mapper : IRegister
    {
        public void Register(TypeAdapterConfig config)
        {
            //自定义转换规则
            //config.ForType<Entity, Dto>()
            //    .Map(dest => dest.FullName, src => src.FirstName + src.LastName)
            //    .Map(dest => dest.IdCard, src => src.IdCard.Replace("1234", "****"));

            config.ForType<HrmSubCompany, CompanyDto>()
                .Map(dest => dest.Subcompanycode, src => src.Subcompanycode)
                .Map(dest => dest.Subcompanyname, src => src.Subcompanyname);

            //热门材料
            config.ForType<UfMaterialLibrary, TopMaterialLibraryDto>()
                .Map(dest=>dest.Name,src=>src.Wzmc);

        }
    }
}
